from redis import StrictRedis

class Config(object):
    # DEBUG = True
    SQLALCHEMY_DATABASE_URI = 'mysql://root:123456@127.0.0.1:3306/test_git'
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    SECRET_KEY = 'sdsadasdsadasdsadsdasd'
    # 将 session的数据存储从‘内存’调整到redis 数据库，配置如下！
    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=1)
    SESSION_USE_SIGNER = True
    SESSION_PERMANENT = False
    PERMANENT_SESSION_LIFETIME = 86400


class DevelopmentConfig(Config):

    DEBUG=True

class ProductionConfig(Config):

    DEBUG=False

# 外界调用的接口提供
config_dict={
    'development':DevelopmentConfig,
    'production':ProductionConfig
}